home *** CD-ROM | disk | FTP | other *** search
/ Champak 138 / Volume 138 Aug 19 2011 - Damaged.iso / Games / shadez.swf / scripts / Local / Game / Thing / CShot.as < prev    next >
Encoding:
Text File  |  2011-08-19  |  6.0 KB  |  220 lines

  1.  
  2. {
  3.    if(true)
  4.    {
  5.       CShot = ┬º┬ºnewclass(CShot,CThingSprite);
  6.    }
  7. }
  8.  
  9. package Local.Game.Thing
  10. {
  11.    import Local.*;
  12.    import Local.Game.World.*;
  13.    import Local.Game.World.Map.*;
  14.    import Local.Game.World.Map.Cell.*;
  15.    import Local.Math.*;
  16.    import flash.display.*;
  17.    import flash.events.*;
  18.    import flash.geom.*;
  19.    
  20.    public class CShot extends CThingSprite
  21.    {
  22.       
  23.       public static var colors:Array = [16777215,16777215,16777215];
  24.       
  25.       public static var alphas:Array = null;
  26.       
  27.       public static var spreads:Array = [0,180,255];
  28.       
  29.       {
  30.          ┬º┬ºpush(┬º┬ºfindproperty(alphas));
  31.          ┬º┬ºpush(1 * 0.5);
  32.          ┬º┬ºpush(0.5);
  33.          ┬º┬ºpush(0.5);
  34.          if(true)
  35.          {
  36.             ┬º┬ºpush(┬º┬ºpop() * ┬º┬ºpop());
  37.             ┬º┬ºpush(0 * 0.5);
  38.          }
  39.       }
  40.       
  41.       public var gradientBoxMatrix:Matrix;
  42.       
  43.       internal var mTarget:*;
  44.       
  45.       internal var mTrailReferences:Array;
  46.       
  47.       internal var mTrailPoints:Array;
  48.       
  49.       public function CShot(param1:CPosition)
  50.       {
  51.          if(true)
  52.          {
  53.             super();
  54.             if(true)
  55.             {
  56.                mBaseType = "shot";
  57.                if(true)
  58.                {
  59.                   mPosition = param1;
  60.                   if(true)
  61.                   {
  62.                      mTrailPoints = [param1.Clone()];
  63.                      if(true)
  64.                      {
  65.                         mTrailReferences = new Array();
  66.                      }
  67.                      mTargetAirbourne = false;
  68.                   }
  69.                   mDisposable = true;
  70.                }
  71.                MapAdd();
  72.             }
  73.             zDepth = 500;
  74.          }
  75.       }
  76.       
  77.       override public function Dispose() : void
  78.       {
  79.          var _loc1_:CCell = null;
  80.          if(true)
  81.          {
  82.             if(mDisposed)
  83.             {
  84.                if(true)
  85.                {
  86.                   return;
  87.                }
  88.             }
  89.             else
  90.             {
  91.                super.Dispose();
  92.             }
  93.             if(mTrailReferences)
  94.             {
  95.                addr30:
  96.                for each(_loc1_ in mTrailReferences)
  97.                {
  98.                   if(true)
  99.                   {
  100.                      _loc1_.RemoveRefThing(this);
  101.                   }
  102.                }
  103.             }
  104.             return;
  105.          }
  106.          ┬º┬ºgoto(addr30);
  107.       }
  108.       
  109.       public function MapMoveTrail() : Boolean
  110.       {
  111.          mTrailPoints.unshift(mPosition.Clone());
  112.          if(mCellCurrent.InCell(mPosition.x))
  113.          {
  114.             ┬º┬ºpush(false);
  115.             if(true)
  116.             {
  117.                return ┬º┬ºpop();
  118.             }
  119.          }
  120.          else
  121.          {
  122.             mTrailReferences.push(mCellCurrent);
  123.             mCellCurrent.AddRefThing(this);
  124.             mCellCurrent.RemoveThing(this);
  125.             mCellCurrent = mMap.AddThing(this);
  126.             ┬º┬ºpush(true);
  127.          }
  128.          return ┬º┬ºpop();
  129.       }
  130.       
  131.       public function DrawTrail(param1:Number, param2:Number = 180) : *
  132.       {
  133.          var _loc3_:Graphics = null;
  134.          var _loc4_:* = NaN;
  135.          var _loc5_:Number = NaN;
  136.          var _loc6_:Function = null;
  137.          var _loc7_:CPosition = null;
  138.          if(mTrailPoints.length < 2 || mInvisible || CGlobal.mFastRender)
  139.          {
  140.             return;
  141.          }
  142.          _loc3_ = mcDrawScratch.graphics;
  143.          if(true)
  144.          {
  145.             _loc3_.clear();
  146.             if(true)
  147.             {
  148.                ┬º┬ºpush(mPosition.x - mLandscape.mDrawPosition.x);
  149.                if(true)
  150.                {
  151.                   ┬º┬ºpush(┬º┬ºpop());
  152.                   if(true)
  153.                   {
  154.                      _loc4_ = ┬º┬ºpop();
  155.                      if(true)
  156.                      {
  157.                         addr70:
  158.                         _loc5_ = mPosition.y - mLandscape.mDrawPosition.y;
  159.                         addr69:
  160.                         if(true)
  161.                         {
  162.                            if(!gradientBoxMatrix)
  163.                            {
  164.                               if(true)
  165.                               {
  166.                                  gradientBoxMatrix = new Matrix();
  167.                               }
  168.                               gradientBoxMatrix.createGradientBox(param2 * 2 * (mTrailPoints[1].x < mPosition.x ? -1 : 1),1000,0,0,0);
  169.                            }
  170.                         }
  171.                         gradientBoxMatrix.tx = mTrailPoints[1].x < mPosition.x ? _loc4_ - param2 : _loc4_ + param2;
  172.                      }
  173.                      _loc3_.lineStyle(param1);
  174.                      ┬º┬ºgoto(addr131);
  175.                   }
  176.                   ┬º┬ºgoto(addr69);
  177.                }
  178.                ┬º┬ºgoto(addr70);
  179.             }
  180.             addr131:
  181.             _loc3_.lineGradientStyle(GradientType.LINEAR,colors,alphas,spreads,gradientBoxMatrix,SpreadMethod.PAD);
  182.             ┬º┬ºgoto(addr141);
  183.          }
  184.          addr141:
  185.          _loc6_ = _loc3_.moveTo;
  186.          for each(_loc7_ in mTrailPoints)
  187.          {
  188.             ┬º┬ºpush(_loc7_.x - mLandscape.mDrawPosition.x);
  189.             if(true)
  190.             {
  191.                ┬º┬ºpush(┬º┬ºpop());
  192.                if(true)
  193.                {
  194.                   _loc4_ = ┬º┬ºpop();
  195.                   if(true)
  196.                   {
  197.                      addr178:
  198.                      _loc5_ = _loc7_.y - mLandscape.mDrawPosition.y;
  199.                      _loc6_(_loc4_,_loc5_);
  200.                      addr177:
  201.                   }
  202.                   _loc6_ = _loc3_.lineTo;
  203.                   if(true)
  204.                   {
  205.                      if(Math.abs(_loc7_.x - mPosition.x) <= param2 * 2)
  206.                      {
  207.                         continue;
  208.                      }
  209.                   }
  210.                   break;
  211.                }
  212.                ┬º┬ºgoto(addr177);
  213.             }
  214.             ┬º┬ºgoto(addr178);
  215.          }
  216.          bPlane.draw(mcDrawScratch);
  217.       }
  218.    }
  219. }
  220.